const randomString = require('./noStr')

const options = {
  salt: randomString(36),
  // How long tokens will be valid since creation
  ttl: 3600,
  // Function for verifying validity of the application secret key
  checkAppSecret: (userId, userSecret, cb) => {
    // Return promise OR use callback
    return Promise.resolve(true)
  },
  // Function for verifying validity of the user secret key
  checkUserSecret: (userId, userSecret, cb) => {
    return Promise.resolve(true)
  },
  // Function for verifying the session existence
  checkSession: (sessionId, cb) => {
    return Promise.resolve(true)
  }
}

const OauthToken = require('oauth-token')(options)
module.exports = OauthToken
